package com.framework.controller.newcontroller;


import com.framework.entity.or.OrAppAdv;
import com.framework.exception.util.RespResult;
import com.framework.service.OrAppAdvService;
import com.framework.service.SysOpinionService;
import com.framework.service.index.IndexService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author wq
 */
@RequestMapping("new")
@RestController
@Api(value="其他模块",tags={"其他模块"})
public class OtherNewController {
    @Autowired
    private IndexService indexService;

    @Autowired
    private SysOpinionService sysOpinionService;

    @Autowired
    private OrAppAdvService orAppAdvService;

    /**
     * 获取银行卡名称列表
     * @return
     */
    @GetMapping("getBankNameList")
    @ApiOperation("根据所属渠道查询首页信息")
    public RespResult getIndexOther() {
        List<String> list= indexService.getBankNameList();
        return RespResult.ok().put("bankNameList",list);
    }

    /**
     * 提交意见反馈
     * @return
     */
    @PostMapping("user/addOpinion")
    @ApiOperation("提交意见反馈")
    public RespResult addOpinion(String token,String content) {
        sysOpinionService.addOpinion(token,content);
        return RespResult.ok();
    }

    /**
     * 获取弹窗列表
     * @param token
     * @return
     */
    @PostMapping("user/getAdvList")
    @ApiOperation("获取弹窗列表")
    public  RespResult getAdvList(String token){
        List<OrAppAdv> list=orAppAdvService.getIndexAdv(token);
        return RespResult.ok().put("list",list);
    }


}
